//
//  UIButton+Extension.swift
//  徐工微博
//
//  Created by ahfu on 2017/4/16.
//  Copyright © 2017年 ahfu. All rights reserved.
//

import UIKit

extension UIButton {
    class func setButton(title: String, fontSize: CGFloat, normalColor: UIColor, highlightedTextColor: UIColor, imageName: String) -> UIButton{
        let button = UIButton()
        button.setTitle(title, for: .normal)
        button.setTitleColor(normalColor, for: .normal)
        button.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        button.setTitleColor(highlightedTextColor, for: .highlighted)
        button.setBackgroundImage(UIImage(named: imageName), for: .normal)
        //button.setImage(UIImage(named: imageName), for: .normal)
        //button.sizeToFit()
        return button
    }
}
